#ifndef HISTORY_H
#define HISTORY_H

#include <QMainWindow>
#include <QTimer>
#include "qcustomplot.h"
#include "qmqtt.h"
#include <QtWidgets>
#include <QDateTime>

namespace Ui {
class History;
}

class History : public QMainWindow
{
    Q_OBJECT
signals:
    void dataDownSignal(QMQTT::Message);
    void  SelectSignal();
protected:
    void paintEvent(QPaintEvent*);
public:
    explicit History(QWidget *parent = 0);
    ~History();
    //设置qcustomplot画图属性，实时
    void setupRealtimeDataDemo(QCustomPlot *customPlot);
    int val11;
    int val12;
public slots:
    void dataUpSlot(const QByteArray&);//数据接收槽函数
    void realtimeDataSlot();//添加实时数据槽
    void btnwenduhistorySlot();
    void btnshiduhistorySlot();
    void run();
    void timeoutSlot();// 定时器触发的槽函数
private:
    QTimer* timer; // 定时器对象
    Ui::History *ui;
    QTimer dataTimer;//定时器，周期调用realtimeDataSlot()槽，实现动态数据添加到曲线
    void publish(QByteArray);
    QVector<double> temper;
    QVector<double> shidu;
    QVector<double> time_temper;
    QVector<double> time_shidu;
};

#endif // HISTORY_H
